<?php
class Default_Form_author extends Zend_Form{
    public function init()
    {
           $this->setAction('')->setMethod('post');
        $name=new Zend_Form_Element_Text("au_name");
        $name->setRequired(true)
            ->addValidator('alnum')
            ->addValidator('StringLength', false, array(6, 20))
            ->addErrorMessage("Name must be more than 6 characters");
            
        $age=new Zend_Form_Element_Text("au_age");
        $age->setRequired(true)
            ->addValidator("regex",false,'/^\d+$/')
            ->addErrorMessage("age must be a numeric");
        
        $address=new Zend_Form_Element_Text("au_address");
        $address->setRequired(true);
        
        $information=new Zend_Form_Element_Textarea("au_information",array("cols"=>40,"rows"=>10));
        $information->setRequired(true);
        
        
        $submit=new Zend_Form_Element_Submit("submit","submit");
        
        $this->setDecorators(array(
                          array('viewScript',
                          array('viewScript'=>'author.phtml'),
                     )));
                                                    
        $name->removeDecorator('HtmlTag')
             ->removeDecorator('Label');
        $address->removeDecorator('HtmlTag')
             ->removeDecorator('Label');
        $age->removeDecorator('HtmlTag')
             ->removeDecorator('Label');
        $information->removeDecorator('HtmlTag')
             ->removeDecorator('Label');
          
        
        
        
        $this->addElements(array($name,$age,$address,$information,$submit));
    
    }
    
    
}